/* 智能助手页面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 算法信息按钮样式 */
.algorithm-info-btn {
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: #00d4aa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.algorithm-info-btn:hover {
    background: rgba(0, 212, 170, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}

/* 算法说明弹窗样式 */
.algorithm-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.algorithm-info-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.algorithm-info-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease-out;
}

.algorithm-info-header {
    background: linear-gradient(45deg, #1a2a6c, #2c3e50);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.algorithm-info-header h3 {
    color: #00d4aa;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.algorithm-info-header .close-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.algorithm-info-header .close-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

.algorithm-info-body {
    padding: 30px;
    color: #fff;
    line-height: 1.8;
}

.algorithm-section {
    margin-bottom: 25px;
}

.algorithm-section h4 {
    color: #00d4aa;
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.algorithm-section p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.algorithm-formula {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    color: #00d4aa;
    white-space: pre-line;
}

.algorithm-data-source {
    background: rgba(161, 196, 253, 0.1);
    border: 1px solid rgba(161, 196, 253, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.algorithm-data-source h5 {
    color: #a1c4fd;
    margin-bottom: 8px;
    font-size: 1rem;
}

.algorithm-data-source ul {
    list-style: none;
    padding-left: 0;
}

.algorithm-data-source li {
    padding: 5px 0;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    padding-left: 20px;
}

.algorithm-data-source li:before {
    content: "📊";
    position: absolute;
    left: 0;
    top: 5px;
}

.algorithm-reference {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.algorithm-reference h5 {
    color: #ffc107;
    margin-bottom: 8px;
    font-size: 1rem;
}

.algorithm-reference p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body {
    background: linear-gradient(135deg, #1a2a6c, #2c3e50, #4a235a);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* 返回导航 */
.nav-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 头部区域 */
.assistant-header {
    text-align: center;
    padding: 50px 0 30px;
    margin-bottom: 30px;
}

.assistant-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.assistant-title i {
    font-size: 2.5rem;
    color: #00d4aa;
}

.assistant-title h1 {
    font-size: 2.8rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #00d4aa, #a1c4fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-indicator.online {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.5);
}

.assistant-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 导航标签 */
.assistant-nav {
    margin-bottom: 30px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.nav-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: linear-gradient(45deg, #00d4aa, #a1c4fd);
    border-color: rgba(0, 212, 170, 0.5);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

/* 标签内容 */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* 主要内容区域 */
.assistant-main {
    min-height: 600px;
}

#assistant-content.active {
    display: grid !important;
    grid-template-columns: 2fr 280px;
    gap: 15px;
    min-height: 700px;
}

#health-content.active {
    display: block !important;
}

@media (max-width: 1200px) {
    #assistant-content.active {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* 健康状态页面样式 - 重新设计 */
#health-content {
    width: 100%;
}

.health-dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-height: 600px;
    padding: 0 20px;
}

/* 通用部分标题样式 */
.section-title {
    color: #00d4aa;
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 212, 170, 0.3);
}

/* 综合健康状态概览 */
.health-overview {
    margin-bottom: 10px;
}

.comprehensive-health-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.comprehensive-health-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 212, 170, 0.2);
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.health-header h3 {
    color: #00d4aa;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.overall-score {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: #00d4aa;
    text-shadow: 0 2px 15px rgba(0, 212, 170, 0.4);
}

.score-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 6个健康维度 */
.health-dimensions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.dimension-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.dimension-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: rgba(0, 212, 170, 0.3);
}

.dimension-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.dimension-info {
    text-align: center;
}

.dimension-score {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.dimension-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 维度特定颜色 */
.dimension-item.mental:hover { border-color: rgba(138, 43, 226, 0.5); }
.dimension-item.physical:hover { border-color: rgba(255, 99, 132, 0.5); }
.dimension-item.learning:hover { border-color: rgba(54, 162, 235, 0.5); }
.dimension-item.time:hover { border-color: rgba(255, 206, 86, 0.5); }
.dimension-item.goal:hover { border-color: rgba(75, 192, 192, 0.5); }
.dimension-item.balance:hover { border-color: rgba(153, 102, 255, 0.5); }

/* 心理健康专区 */
.mental-health-section {
    margin-bottom: 20px;
}

.mental-health-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.mental-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mental-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.mental-card h4 {
    color: #a1c4fd;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 压力监测样式 */
.stress-gauge {
    margin-bottom: 15px;
}

.gauge-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #ffc107, #ff6b6b);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.stress-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffc107;
}

.stress-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stress-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.factor-label {
    color: rgba(255, 255, 255, 0.8);
}

.factor-value {
    color: white;
    font-weight: 600;
}

.stress-recommendation {
    background: rgba(0, 212, 170, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    border-left: 3px solid #00d4aa;
}

/* 情绪健康样式 */
.emotion-stability, .emotion-trend {
    margin-bottom: 12px;
}

.stability-label, .trend-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

.stability-value {
    color: #00d4aa;
    font-weight: 600;
}

.emotion-icons {
    display: flex;
    gap: 5px;
    font-size: 1.2rem;
}

.emotion-stats {
    display: flex;
    justify-content: space-between;
}

.emotion-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px;
}

.stat-value {
    color: white;
    font-weight: 600;
}

/* 焦虑风险评估样式 */
.risk-level {
    margin-bottom: 15px;
}

.risk-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.risk-value {
    font-weight: 600;
    margin-left: 8px;
}

.risk-value.low-medium {
    color: #ffc107;
}

.risk-factors {
    margin-bottom: 12px;
}

.risk-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.factor-name {
    color: rgba(255, 255, 255, 0.8);
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 0.8rem;
}

.star.filled {
    color: #ffc107;
}

.anxiety-detail {
    background: rgba(255, 193, 7, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 心理健康建议样式 */
.mental-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tip-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

/* 核心指标卡片区域 */
.core-metrics-section {
    margin-bottom: 20px;
}

.core-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.metric-card h4 {
    color: #a1c4fd;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-main {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.metric-unit {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.metric-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.metric-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.detail-label {
    color: rgba(255, 255, 255, 0.7);
}

.detail-value {
    color: white;
    font-weight: 500;
}

/* 趋势相关样式 */
.trend-up {
    color: #00d4aa;
}

.trend-down {
    color: #ff6b6b;
}

.trend-stable {
    color: #ffc107;
}

/* 数据可视化区域 */
.health-visualization-section {
    margin-bottom: 20px;
}

.visualization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
}

.chart-card h4 {
    color: #a1c4fd;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card .chart-container {
    position: relative;
    height: 280px;
    margin-top: 10px;
}

/* 聊天区域 */
.chat-section {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 170, 0.2);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
    transition: all 0.3s ease;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    min-height: 500px;
}

.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.message.user-message {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assistant-message .avatar {
    background: linear-gradient(45deg, #00d4aa, #a1c4fd);
    color: white;
}

.user-message .avatar {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    color: white;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.user-message .message-content {
    text-align: right;
}

.message-text {
    background: rgba(255, 255, 255, 0.1);
    padding: 18px 22px;
    border-radius: 18px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 8px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.user-message .message-text {
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.message-text p {
    margin-bottom: 10px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-text li {
    margin-bottom: 5px;
}

.message-time {
    font-size: 0.8rem;
    opacity: 0.6;
    padding: 0 5px;
}

/* 输入区域 */
.chat-input-container {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quick-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.5);
    transform: translateY(-2px);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.send-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00d4aa, #a1c4fd);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 212, 170, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 信息面板 */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: fit-content;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.panel-header h3 {
    color: #a1c4fd;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    margin-bottom: 15px;
}

.info-card:hover {
    transform: translateY(-2px);
}

.info-card h4 {
    margin-bottom: 15px;
    color: #fad0c4;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4aa;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 建议列表 */
.suggestions-list {
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}

.suggestion-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 快速操作 */
.quick-operations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.operation-btn {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.9rem;
}

.operation-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.5);
    transform: translateX(5px);
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 200px;
    margin-top: 10px;
}

/* 聊天历史控件 */
.chat-history-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.date-input {
    flex: 1;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.load-history-btn {
    padding: 8px 12px;
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.4);
    border-radius: 6px;
    color: #00d4aa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.load-history-btn:hover {
    background: rgba(0, 212, 170, 0.3);
    transform: translateY(-1px);
}

.history-info {
    margin-top: 5px;
}

.history-info small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* 消息复制按钮 */
.message-content {
    position: relative;
}

.copy-message-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message:hover .copy-message-btn {
    opacity: 1;
}

.copy-message-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.4);
    color: #00d4aa;
    transform: translateY(-1px);
}

.copy-message-btn.copied {
    background: rgba(0, 212, 170, 0.3);
    border-color: #00d4aa;
    color: #00d4aa;
}

.copy-message-btn i {
    font-size: 0.75rem;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(26, 42, 108, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1001;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    color: #a1c4fd;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

.settings-content {
    padding: 20px;
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group h4 {
    margin-bottom: 15px;
    color: #fad0c4;
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
}

.setting-item label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.setting-item select {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    min-width: 150px;
}

.setting-item select option {
    background: #2c3e50;
    color: white;
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #00d4aa;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #00d4aa, #a1c4fd);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.settings-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* 打字机效果 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 5px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 212, 170, 0.6);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-back {
        position: relative;
        margin-bottom: 20px;
    }
    
    /* 健康页面响应式 */
    .health-dimensions {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .dimension-item {
        padding: 15px 10px;
    }
    
    .dimension-icon {
        font-size: 2rem;
    }
    
    .dimension-score {
        font-size: 1.5rem;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .mental-health-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .core-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .visualization-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-card .chart-container {
        height: 220px;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .nav-tabs {
        gap: 5px;
    }
    
    .nav-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .assistant-header {
        padding: 20px 0;
    }
    
    .assistant-title h1 {
        font-size: 2rem;
    }
    
    .assistant-main {
        grid-template-columns: 1fr;
    }
    
    .info-panel {
        order: 2;
    }
    
    .chat-messages {
        min-height: 400px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .settings-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}


/* 错误消息样式 */
.error {
    color: #ff4757;
    font-weight: 500;
}

/* 代码块样式 */
.code-block {
    background: #2b2b2b;
    color: #f8f8f2;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.code-block code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
}

/* 行内代码样式 */
.message-text code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.assistant-message .message-text code {
    background: rgba(255, 255, 255, 0.1);
}

/* 工具调用状态样式 */
.tool-call-status {
    margin-bottom: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(161, 196, 253, 0.1));
    border: 1px solid rgba(0, 212, 170, 0.3);
    padding: 15px;
    backdrop-filter: blur(5px);
    animation: toolCallAppear 0.3s ease-out;
    transition: all 0.3s ease;
}

@keyframes toolCallAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tool-call-indicator {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tool-call-spinner {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 170, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 170, 0.4);
}

.tool-call-spinner i {
    color: #00d4aa;
    font-size: 14px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tool-call-info {
    flex: 1;
    min-width: 0;
}

.tool-call-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #a1c4fd;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-call-title i {
    font-size: 0.9rem;
}

.tool-call-details {
    margin-bottom: 10px;
}

.tool-call-details strong {
    color: #00d4aa;
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.tool-call-args {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-family: 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-call-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #a1c4fd);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    min-width: 80px;
    font-weight: 500;
}

/* 工具调用完成状态 */
.tool-call-status.completed .tool-call-spinner {
    background: rgba(0, 212, 170, 0.3);
    border-color: #00d4aa;
}

.tool-call-status.completed .progress-fill {
    background: #00d4aa;
}

.tool-call-status.completed .progress-text {
    color: #00d4aa;
}

/* 多个工具调用时的样式 */
.tool-call-status + .tool-call-status {
    margin-top: 10px;
}

/* MCP工具状态样式 - 优化版 */
.mcp-tools-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.mcp-status-none {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.mcp-status-loading {
    color: #a1c4fd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcp-status-empty {
    text-align: center;
    padding: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.mcp-config-link {
    display: inline-block;
    margin-top: 8px;
    color: #00d4aa;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    background: rgba(0, 212, 170, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 170, 0.3);
    transition: all 0.3s ease;
}

.mcp-config-link:hover {
    background: rgba(0, 212, 170, 0.2);
    transform: translateY(-1px);
}

.mcp-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mcp-tools-count {
    font-weight: 600;
    color: #00d4aa;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mcp-refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.mcp-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mcp-servers-list {
    margin-bottom: 12px;
}

.mcp-server-item {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.mcp-server-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
    padding: 0;
}

.mcp-server-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #00d4aa;
    cursor: pointer;
    flex-shrink: 0;
}

.mcp-server-item.connected .mcp-server-checkbox {
    accent-color: #00d4aa;
}

.mcp-server-item.disconnected .mcp-server-checkbox {
    accent-color: #ffc107;
}

.mcp-server-item.disabled .mcp-server-checkbox {
    accent-color: #6c757d;
    opacity: 0.6;
}

.mcp-server-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mcp-server-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.mcp-server-item:last-child {
    border-bottom: none;
}

.mcp-server-item.connected .mcp-server-name {
    color: #00d4aa;
}

.mcp-server-item.disconnected .mcp-server-name {
    color: #ff6b6b;
}

.mcp-server-item.disabled .mcp-server-name {
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.4);
}

.mcp-server-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mcp-server-name::before {
    content: '🔧';
    font-size: 0.8rem;
}

.mcp-server-item.connected .mcp-server-name::before {
    content: '✅';
}

.mcp-server-item.disconnected .mcp-server-name::before {
    content: '❌';
}

.mcp-server-item.disabled .mcp-server-name::before {
    content: '⏸️';
}

.mcp-server-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    line-height: 1.3;
}

.mcp-tools-details {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.mcp-tools-details summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: #a1c4fd;
    margin-bottom: 0;
    padding: 12px 16px;
    background: rgba(161, 196, 253, 0.1);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mcp-tools-details summary:hover {
    background: rgba(161, 196, 253, 0.2);
}

.mcp-tools-details[open] summary {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mcp-tools-list {
    padding: 12px 16px 0;
}

.mcp-tool-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
}

.mcp-tool-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 4px;
}

.mcp-tool-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mcp-tool-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    font-size: 0.9rem;
}

.mcp-tool-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    display: block;
    line-height: 1.4;
}

/* MCP工具对话框样式 */
/* MCP 工具对话框 - 优化版本 */
.mcp-tools-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mcp-tools-dialog.active {
    opacity: 1;
    visibility: visible;
}

.mcp-tools-dialog.closing {
    opacity: 0;
    transform: scale(0.95);
}

.mcp-tools-dialog-content {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.mcp-tools-dialog.active .mcp-tools-dialog-content {
    transform: scale(1);
}

/* 对话框头部 */
.mcp-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, #1e293b, #0f172a);
    border-radius: 20px 20px 0 0;
}

.dialog-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.dialog-title i {
    color: #00d4aa;
    font-size: 1.5rem;
}

.dialog-title h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.tools-count {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.close-dialog-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-dialog-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

/* 搜索区域 */
.mcp-dialog-search {
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

#toolSearchInput {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#toolSearchInput:focus {
    outline: none;
    border-color: #00d4aa;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

#toolSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.filter-btn.active {
    background: rgba(0, 212, 170, 0.2);
    border-color: #00d4aa;
    color: #00d4aa;
}

/* 对话框主体 */
.mcp-dialog-body {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 服务器分组 */
.tools-server-group {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.server-header {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.1), rgba(0, 212, 170, 0.05));
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.server-header i {
    color: #00d4aa;
    font-size: 1.1rem;
}

.server-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.server-tools {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

/* 工具卡片 */
.tool-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00d4aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.15);
}

.tool-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.tool-icon {
    background: linear-gradient(135deg, #00d4aa, #0ea5e9);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    word-break: break-word;
}

.tool-server {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.tool-action-btn {
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: #00d4aa;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.tool-card:hover .tool-action-btn {
    opacity: 1;
}

.tool-action-btn:hover {
    background: rgba(0, 212, 170, 0.3);
    transform: scale(1.1);
}

.tool-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-category {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.btn-use {
    background: linear-gradient(135deg, #00d4aa, #0ea5e9);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-use:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

/* 参数展示 */
.tool-params {
    margin: 12px 0;
}

.params-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.params-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.params-content {
    display: none;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.params-content pre {
    margin: 0;
    color: #a1c4fd;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 对话框底部 */
.mcp-dialog-footer {
    padding: 20px 30px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 20px 20px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4aa, #0ea5e9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* 空状态样式 */
.mcp-tools-dialog-content.empty-state {
    max-width: 500px;
    text-align: center;
}

.empty-state-content {
    padding: 40px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mcp-tool-option p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 0.9rem;
}

.mcp-tool-option details {
    margin-top: 8px;
}

.mcp-tool-option details summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: #007bff;
}

.mcp-tool-option details pre {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    overflow-x: auto;
    margin-top: 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mcp-tools-dialog-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .mcp-dialog-header {
        padding: 20px 20px 15px;
    }
    
    .dialog-title h3 {
        font-size: 1.3rem;
    }
    
    .mcp-dialog-search {
        padding: 15px 20px;
    }
    
    .mcp-dialog-body {
        padding: 15px 20px;
    }
    
    .server-tools {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .tool-card {
        padding: 15px;
    }
    
    .mcp-dialog-footer {
        padding: 15px 20px;
    }
    
    .dialog-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .search-filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* MCP工具选择样式 - 优化版 */
.mcp-tool-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mcp-tool-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mcp-tool-checkbox {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #00d4aa;
    margin-top: 2px;
    flex-shrink: 0;
}

.mcp-tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mcp-tool-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.mcp-tool-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.1);
}

.mcp-tool-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mcp-tools-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 8px 8px;
}

.mcp-tools-select-all, .mcp-tools-select-none {
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.4);
    color: white;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    flex: 1;
}

.mcp-tools-select-all:hover, .mcp-tools-select-none:hover {
    background: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.mcp-tools-select-all {
    background: rgba(0, 212, 170, 0.25);
}

.mcp-tools-select-none {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.4);
}

.mcp-tools-select-none:hover {
    background: rgba(255, 107, 107, 0.3);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.mcp-info {
    margin-top: 15px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 212, 170, 0.05);
    border-radius: 6px;
}

.mcp-info small {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* MCP工具搜索框样式 */
.mcp-tools-search input {
    transition: all 0.3s ease;
}

.mcp-tools-search input:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
    background: rgba(255, 255, 255, 0.15) !important;
}

.mcp-tools-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* MCP工具统计样式 */
.mcp-tools-stats {
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.mcp-tools-stats i {
    color: rgba(0, 212, 170, 0.8);
    margin-right: 4px;
}

/* 展开状态样式 */
.mcp-tools-expanded .mcp-tools-list {
}

.mcp-tools-expanded {
}

/* MCP工具管理大面板样式 */
.mcp-tools-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.mcp-tools-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 212, 170, 0.1);
    border-radius: 15px 15px 0 0;
}

.mcp-tools-panel-header h3 {
    color: #00d4aa;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.mcp-tools-panel-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mcp-panel-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    padding: 10px 12px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mcp-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mcp-tools-panel-content {
    padding: 0;
    overflow: visible;
    transition: all 0.5s ease;
    max-height: none;
}

.mcp-tools-panel.collapsed .mcp-tools-panel-content {
    max-height: 0;
    padding: 0;
}

.mcp-tools-panel.collapsed .mcp-panel-toggle i {
    transform: rotate(180deg);
}

/* 大面板工具状态样式 */
.mcp-tools-status-large {
    padding: 30px;
    display: block;
}

.mcp-tools-status-large .mcp-status-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    color: #a1c4fd;
    min-height: 200px;
}

.mcp-tools-status-large .mcp-status-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.mcp-tools-status-large .mcp-status-empty > div:first-child {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mcp-tools-status-large .mcp-config-link {
    font-size: 1.1rem;
    padding: 12px 24px;
    margin-top: 20px;
}

/* 大面板工具列表网格布局 */
.mcp-tools-large-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 30px;
    align-items: start;
    height: auto;
}

.mcp-servers-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    height: auto;
}

.mcp-servers-section h4 {
    color: #a1c4fd;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcp-tools-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: auto;
}

.mcp-tools-section h4 {
    color: #00d4aa;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 大面板工具搜索框 */
.mcp-tools-search-large {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.mcp-tools-search-large input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mcp-tools-search-large input:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* 大面板工具列表 */
.mcp-tools-list-large {
    padding-right: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
    height: auto;
}

.mcp-tools-list-large .mcp-tool-item {
    padding: 15px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: fit-content;
    transition: all 0.2s ease;
}

.mcp-tools-list-large .mcp-tool-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
}

.mcp-tools-list-large .mcp-tool-name {
    font-size: 1rem;
    font-weight: 600;
}

.mcp-tools-list-large .mcp-tool-desc {
    font-size: 0.9rem;
    margin-top: 6px;
    line-height: 1.4;
}

/* 大面板操作按钮 */
.mcp-tools-actions-large {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0 0 10px 10px;
}

.mcp-tools-actions-large button {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 120px;
}

/* 信息网格样式 */
.mcp-info-large {
    padding: 30px;
    background: rgba(0, 212, 170, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.mcp-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.mcp-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.mcp-info-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.mcp-info-item i {
    color: #00d4aa;
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.mcp-info-item strong {
    color: #a1c4fd;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.mcp-info-item p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
    margin: 0;
    font-size: 0.8rem;
}

.mcp-info-item a {
    color: #00d4aa;
    text-decoration: none;
    font-weight: 500;
}

.mcp-info-item a:hover {
    text-decoration: underline;
}

/* 响应式设计 - MCP工具 */
@media (max-width: 1024px) and (min-width: 769px) {
    .mcp-info-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 18px;
    }
    
    .mcp-info-item {
        min-height: 120px;
    }
}

@media (max-width: 768px) {
    .mcp-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .mcp-tools-dialog-content {
        width: 98%;
        max-width: 95%;
        margin: 10px;
    }
    
    .mcp-tools-actions {
        justify-content: center;
    }
    
    /* 大面板响应式 */
    .mcp-tools-panel {
        margin: 10px 5px 0;
        border-radius: 10px;
    }
    
    .mcp-tools-panel-header {
        padding: 15px 20px;
    }
    
    .mcp-tools-panel-header h3 {
        font-size: 1.2rem;
    }
    
    .mcp-tools-status-large {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .mcp-tools-list-large {
        grid-template-columns: 1fr; /* 移动端单列显示 */
        gap: 8px; /* 减少间距 */
    }
    
    .mcp-tools-section {
        width: 100%;
    }
    
    .mcp-tools-large-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mcp-servers-section {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .mcp-info-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: 15px;
    }
    
    .mcp-info-large {
        padding: 20px;
    }
    
    .mcp-tools-actions-large {
        flex-direction: column;
        padding: 15px;
        margin-top: 15px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
    }
    
    .mcp-tools-actions-large button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .mcp-tools-actions-large button:last-child {
        margin-bottom: 0;
    }
    
    /* MCP工具项移动端优化 */
    .mcp-tools-list-large .mcp-tool-item {
        padding: 12px 15px; /* 减少padding */
        margin-bottom: 0;
    }
    
    .mcp-tools-list-large .mcp-tool-name {
        font-size: 0.95rem; /* 稍微减小字体 */
        font-weight: 600;
        line-height: 1.3; /* 紧凑行高 */
    }
    
    .mcp-tools-list-large .mcp-tool-desc {
        font-size: 0.85rem; /* 减小描述字体 */
        margin-top: 4px; /* 减少间距 */
        line-height: 1.3; /* 紧凑行高 */
        color: rgba(255, 255, 255, 0.8); /* 稍微降低对比度 */
    }
    
    /* 工具选择框移动端优化 */
    .mcp-tool-item .mcp-tool-checkbox {
        width: 16px; /* 稍微减小复选框 */
        height: 16px;
        margin-right: 8px; /* 减少右边距 */
    }
    
    /* 服务器状态区域移动端优化 */
    .mcp-servers-section {
        padding: 15px; /* 减少padding */
        margin-bottom: 15px;
    }
    
    .mcp-servers-section h4 {
        font-size: 1rem; /* 减小标题字体 */
        margin-bottom: 10px;
    }
}

/* 超小屏幕特殊优化（480px以下） */
@media (max-width: 480px) {
    .mcp-tools-panel-header {
        padding: 12px 15px; /* 进一步减少header padding */
    }
    
    .mcp-tools-panel-header h3 {
        font-size: 1.1rem; /* 减小标题字体 */
        gap: 8px;
    }
    
    .mcp-tools-status-large {
        padding: 15px; /* 减少padding */
    }
    
    .mcp-tools-list-large {
        height: auto; /* 自适应高度 */
        gap: 6px; /* 进一步减少间距 */
        padding-right: 5px; /* 减少右侧padding */
    }
    
    .mcp-tools-list-large .mcp-tool-item {
        padding: 10px 12px; /* 更紧凑的padding */
        border-radius: 6px; /* 稍小的圆角 */
    }
    
    .mcp-tools-list-large .mcp-tool-name {
        font-size: 0.9rem; /* 进一步减小字体 */
        line-height: 1.2;
    }
    
    .mcp-tools-list-large .mcp-tool-desc {
        font-size: 0.8rem; /* 进一步减小描述字体 */
        margin-top: 3px;
        line-height: 1.2;
        /* 限制描述文本最大行数，避免过长 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mcp-tools-actions-large {
        padding: 12px 15px; /* 减少操作区域padding */
    }
    
    .mcp-tools-actions-large button {
        padding: 10px 20px; /* 减少按钮padding */
        font-size: 0.9rem; /* 减小按钮字体 */
        min-width: 100px; /* 减少最小宽度 */
    }
    
    .mcp-tools-section {
        height: auto; /* 自适应高度 */
        padding: 15px; /* 减少padding */
    }
    
    .mcp-servers-section {
        padding: 12px; /* 进一步减少padding */
        margin-bottom: 12px;
    }
}

/* Markdown渲染样式（与博客系统一致） */
.message-text {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;               /* 允许横向滚动，避免表格被裁切 */
    -webkit-overflow-scrolling: touch;
}

/* 标题样式 */
.message-text h1, .message-text h2, .message-text h3, .message-text h4, .message-text h5, .message-text h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #00d4aa;
    border-bottom: 1px solid rgba(0, 212, 170, 0.3);
    padding-bottom: 5px;
}

.message-text h1 { font-size: 2em; }
.message-text h2 { font-size: 1.75em; }
.message-text h3 { font-size: 1.5em; }
.message-text h4 { font-size: 1.25em; }
.message-text h5 { font-size: 1.1em; }
.message-text h6 { font-size: 1em; }

/* 段落样式 */
.message-text p {
    margin-bottom: 1em;
}

/* 链接样式 */
.message-text a {
    color: #a1c4fd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.message-text a:hover {
    text-decoration: underline;
    color: #00d4aa;
}

/* 列表样式 */
.message-text ul, .message-text ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

.message-text li {
    margin-bottom: 0.5em;
}

/* 引用样式 */
.message-text blockquote {
    border-left: 4px solid #00d4aa;
    padding-left: 1em;
    margin-left: 0;
    margin-bottom: 1em;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 212, 170, 0.1);
    padding: 10px;
    border-radius: 0 4px 4px 0;
}

/* 代码块样式 */
.message-text pre {
    background: #2b2b2b;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-text code {
    font-family: 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    color: #a1c4fd;
}

.message-text pre code {
    background: transparent;
    padding: 0;
    color: #f8f8f2;
}

/* 图片样式 */
.message-text img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
}

/* 表格样式 */
.message-text table {
    /* 让表格按内容宽度展示，不足时占满容器；超出时由父容器横向滚动 */
    width: max-content;
    max-width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.message-text th, .message-text td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap; /* 避免内容换行导致表格被压缩，结合父容器横向滚动 */
}

.message-text th {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    font-weight: 600;
}

.message-text tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.message-text tr:hover {
    background: rgba(0, 212, 170, 0.05);
}

/* 分割线 */
.message-text hr {
    margin: 20px 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.5), transparent);
}

/* 第一个和最后一个元素的间距 */
.message-text > *:first-child {
    margin-top: 0;
}

.message-text > *:last-child {
    margin-bottom: 0;
}

/* 打字机光标效果 */
.typing-cursor {
    color: #00d4aa;
    font-weight: bold;
    animation: cursor-blink 1s infinite;
    margin-left: 1px;
}

@keyframes cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 流式响应优化 */
.message-text {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 改进的打字效果 */
.streaming-text {
    animation: streaming-fade-in 0.3s ease-in;
}

@keyframes streaming-fade-in {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 设置描述样式 */
.setting-description {
    margin-top: 8px;
    padding-left: 4px;
}

.setting-description small {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    display: block;
}